import numpy as np
from sklearn.linear_model import LogisticRegression

# 生成示例数据
X = np.array([[1], [2], [3], [4], [5]])
y = np.array([0, 0, 0, 1, 1])

# 创建逻辑回归模型并拟合数据
model = LogisticRegression()
model.fit(X, y)

# 预测
y_pred = model.predict(X)
print("Predictions:", y_pred)